﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using HZ.MBSM.DBUtility;

public partial class Supervise_ProductDetails : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {
        System.Collections.Generic.List<HZ.MBSM.DAL.AccountType> _AccountType = new System.Collections.Generic.List<HZ.MBSM.DAL.AccountType>();
        _AccountType.Add(HZ.MBSM.DAL.AccountType.enumAdmin);
        _AccountType.Add(HZ.MBSM.DAL.AccountType.enumSupervise);
        if (HZ.MBSM.BLL.Login.CheckAssert(_AccountType))
        {
            if (!IsPostBack)
            {
                Int64 ProductId;
                string strSql;
                ProductId = Convert.ToInt64(SysFun.IsSQL(Request.QueryString["ProductId"].ToString()));
                Db db = new Db();
                System.Data.IDataReader dr;
                strSql = "select product.*,product_sort.sortName from product,product_sort where product.sortid=product_sort.sortid and  ProductId=" + ProductId;
                dr = db.DataReader(strSql);
                while (dr.Read())
                {
                    txtMedicalCareCode.Text = SysFun.ToTrim(dr["MedicalCareCode"]);
                    txtMedicinemodel.Text = SysFun.ToTrim(dr["Medicinemodel"]);
                    txtOutlookC.Text = SysFun.ToTrim(dr["OutlookC"]);
                    txtProductCode.Text = SysFun.ToTrim(dr["ProductCode"]);                    
                    txtProductId.Text = SysFun.ToTrim(dr["ProductId"]);
                    txtProductId.Visible = false;
                    txtProductName.Text = SysFun.ToTrim(dr["ProductName"]);
                    txtRemark.Text = SysFun.ToTrim(dr["Remark"]);

                    txtSortId1.Text = SysFun.ToTrim(dr["SortId"]);
                    txtSortId1.Visible = false;
                    txtSortName.Text = SysFun.ToTrim(dr["sortName"]);
                    txtUnit.Text = SysFun.ToTrim(dr["Unit"]);
                    if (SysFun.ToBool(dr["IsMedicalCare"] == "1"))
                    {
                        lblIsMedicalCare.Text = "是";
                    }
                    else
                    {
                        lblIsMedicalCare.Text = "否";
                    }
                    if (SysFun.ToTrim(dr["AddDate"]) != "1900-1-1 0:00:00")
                    {
                        txtAddDate.Text = SysFun.ToTrim(dr["AddDate"]);
                    }
              
                    txtAddDate.Visible = false;
                    txtAccountId.Text = SysFun.ToTrim(dr["AccountId"]);
                    txtAccountId.Visible = false;
                    txtXiShu.Text = SysFun.ToTrim(dr["xishu"]);
                    txtZL.Text = SysFun.ToTrim(dr["zl"]);
                    txtHL.Text = SysFun.ToTrim(dr["hl"]);

                }
                dr.Close();
                dr.Dispose();
                db.Close();
            }
        }
    }
    

    protected void Button2_Click(object sender, EventArgs e)
    {
        Response.Write("<script>window.close();</script>");
    }
}
